其他
使用python批量设计引物
使用python批量设计引物
PCR引物设计应该算是生物实验基本技能吧,小编进入实验室第一天,就是学会PCR,设计引物的工具也非常多。Primer-BLAST、Primer Premier 都是比较经典的软件。今天要讲讲怎么用Python来做引物设计,如何用python来批量设计引物,提高自动化水平。
Primer3-py 是 Primer3 在 Python 中的一个“包装”,用 Primer3-py 官方的说法就是:提供一个简单可靠的方式让你能更好的自动化设计引物 (The intention is to provide a simple and reliable interface for automated oligo analysis and design)。NCBI 的 Primer-BLAST 引物设计部分用的就是 Primer3。除此之外,Primer3 还有网页版(http://primer3plus.com/cgi-bin/dev/primer3plus.cgi)和命令行版本,引用次数非常高。
安装
软件安装很简单,使用conda或者pip
pip install primer3-py
conda install -c bioconda primer3-py
使用
计算Tm值
import primer3
primer3.calcTm('GTAAAACGACGGCCAGT')
计算发卡结构
import primer3
primer3.calcHairpin('CCCCCATCCGATCAGGGGG')
计算二聚体
import primer3
primer3.calcHomodimer('CCCCCATCCGATCAGGGGG')
设计引物
使用binding.designPrimers,例子如下:
from primer3 import bindings
bindings.designPrimers(
{
'SEQUENCE_ID': 'MH1000',
'SEQUENCE_TEMPLATE': 'GCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCCTACATTTT
AGCATCAGTGAGTACAGCATGCTTACTGGAAGAGAGGGTCATGCA
ACAGATTAGGAGGTAAGTTTGCAAAGGCAGGCTAAGGAGGAGACG
CACTGAATGCCATGGTAAGAACTCTGGACATAAAAATATTGGAAG
TTGTTGAGCAAGTNAAAAAAATGTTTGGAAGTGTTACTTTAGCAA
TGGCAAGAATGATAGTATGGAATAGATTGGCAGAATGAAGGCAAA
ATGATTAGACATATTGCATTAAGGTAAAAAATGATAACTGAAGAA
TTATGTGCCACACTTATTAATAAGAAAGAATATGTGAACCTTGCA
GATGTTTCCCTCTAGTAG',
'SEQUENCE_INCLUDED_REGION': [36,342]
},
{
'PRIMER_OPT_SIZE': 20,
'PRIMER_PICK_INTERNAL_OLIGO': 1,
'PRIMER_INTERNAL_MAX_SELF_END': 8,
'PRIMER_MIN_SIZE': 18,
'PRIMER_MAX_SIZE': 25,
'PRIMER_OPT_TM': 60.0,
'PRIMER_MIN_TM': 57.0,
'PRIMER_MAX_TM': 63.0,
'PRIMER_MIN_GC': 20.0,
'PRIMER_MAX_GC': 80.0,
'PRIMER_MAX_POLY_X': 100,
'PRIMER_INTERNAL_MAX_POLY_X': 100,
'PRIMER_SALT_MONOVALENT': 50.0,
'PRIMER_DNA_CONC': 50.0,
'PRIMER_MAX_NS_ACCEPTED': 0,
'PRIMER_MAX_SELF_ANY': 12,
'PRIMER_MAX_SELF_END': 8,
'PRIMER_PAIR_MAX_COMPL_ANY': 12,
'PRIMER_PAIR_MAX_COMPL_END': 8,
'PRIMER_PRODUCT_SIZE_RANGE': [[75,100],[100,125],[125,150],
[150,175],[175,200],[200,225]],
})
结果如下:
{'PRIMER_INTERNAL_0': (69, 24),
'PRIMER_INTERNAL_0_GC_PERCENT': 50.0,
'PRIMER_INTERNAL_0_HAIRPIN_TH': 34.31335532251251,
'PRIMER_INTERNAL_0_MIN_SEQ_QUALITY': 20,
'PRIMER_INTERNAL_0_PENALTY': 6.224608874676505,
'PRIMER_INTERNAL_0_SELF_ANY_TH': 0.0,
'PRIMER_INTERNAL_0_SELF_END_TH': 0.0,
'PRIMER_INTERNAL_0_SEQUENCE': 'ACTGGAAGAGAGGGTCATGCAACA',
'PRIMER_INTERNAL_0_TM': 57.775391125323495,
'PRIMER_INTERNAL_1': (69, 24),
'PRIMER_INTERNAL_1_GC_PERCENT': 50.0,
'PRIMER_INTERNAL_1_HAIRPIN_TH': 34.31335532251251,
'PRIMER_INTERNAL_1_MIN_SEQ_QUALITY': 20,
'PRIMER_INTERNAL_1_PENALTY': 6.224608874676505,
'PRIMER_INTERNAL_1_SELF_ANY_TH': 0.0,
'PRIMER_INTERNAL_1_SELF_END_TH': 0.0,
'PRIMER_INTERNAL_1_SEQUENCE': 'ACTGGAAGAGAGGGTCATGCAACA',
'PRIMER_INTERNAL_1_TM': 57.775391125323495,
'PRIMER_INTERNAL_2': (69, 24),
'PRIMER_INTERNAL_2_GC_PERCENT': 50.0,
'PRIMER_INTERNAL_2_HAIRPIN_TH': 34.31335532251251,
'PRIMER_INTERNAL_2_MIN_SEQ_QUALITY': 20,
'PRIMER_INTERNAL_2_PENALTY': 6.224608874676505,
'PRIMER_INTERNAL_2_SELF_ANY_TH': 0.0,
'PRIMER_INTERNAL_2_SELF_END_TH': 0.0,
'PRIMER_INTERNAL_2_SEQUENCE': 'ACTGGAAGAGAGGGTCATGCAACA',
'PRIMER_INTERNAL_2_TM': 57.775391125323495,
'PRIMER_INTERNAL_3': (69, 24),
'PRIMER_INTERNAL_3_GC_PERCENT': 50.0,
'PRIMER_INTERNAL_3_HAIRPIN_TH': 34.31335532251251,
'PRIMER_INTERNAL_3_MIN_SEQ_QUALITY': 20,
'PRIMER_INTERNAL_3_PENALTY': 6.224608874676505,
'PRIMER_INTERNAL_3_SELF_ANY_TH': 0.0,
'PRIMER_INTERNAL_3_SELF_END_TH': 0.0,
'PRIMER_INTERNAL_3_SEQUENCE': 'ACTGGAAGAGAGGGTCATGCAACA',
'PRIMER_INTERNAL_3_TM': 57.775391125323495,
'PRIMER_INTERNAL_4': (69, 24),
'PRIMER_INTERNAL_4_GC_PERCENT': 50.0,
'PRIMER_INTERNAL_4_HAIRPIN_TH': 34.31335532251251,
'PRIMER_INTERNAL_4_MIN_SEQ_QUALITY': 20,
'PRIMER_INTERNAL_4_PENALTY': 6.224608874676505,
'PRIMER_INTERNAL_4_SELF_ANY_TH': 0.0,
'PRIMER_INTERNAL_4_SELF_END_TH': 0.0,
'PRIMER_INTERNAL_4_SEQUENCE': 'ACTGGAAGAGAGGGTCATGCAACA',
'PRIMER_INTERNAL_4_TM': 57.775391125323495,
'PRIMER_INTERNAL_EXPLAIN': 'considered 3007, too many Ns 27, GC content '
'failed 92, low tm 2608, high tm 11, high hairpin '
'stability 18, ok 251',
'PRIMER_INTERNAL_NUM_RETURNED': 5,
'PRIMER_LEFT_0': (46, 21),
'PRIMER_LEFT_0_END_STABILITY': 4.06,
'PRIMER_LEFT_0_GC_PERCENT': 52.38095238095238,
'PRIMER_LEFT_0_HAIRPIN_TH': 42.52778282883122,
'PRIMER_LEFT_0_MIN_SEQ_QUALITY': 20,
'PRIMER_LEFT_0_PENALTY': 1.3299057711502655,
'PRIMER_LEFT_0_SELF_ANY_TH': 10.513588697583486,
'PRIMER_LEFT_0_SELF_END_TH': 10.513588697583486,
'PRIMER_LEFT_0_SEQUENCE': 'GCATCAGTGAGTACAGCATGC',
'PRIMER_LEFT_0_TM': 59.670094228849734,
'PRIMER_LEFT_1': (46, 21),
'PRIMER_LEFT_1_END_STABILITY': 4.06,
'PRIMER_LEFT_1_GC_PERCENT': 52.38095238095238,
'PRIMER_LEFT_1_HAIRPIN_TH': 42.52778282883122,
'PRIMER_LEFT_1_MIN_SEQ_QUALITY': 20,
'PRIMER_LEFT_1_PENALTY': 1.3299057711502655,
'PRIMER_LEFT_1_SELF_ANY_TH': 10.513588697583486,
'PRIMER_LEFT_1_SELF_END_TH': 10.513588697583486,
'PRIMER_LEFT_1_SEQUENCE': 'GCATCAGTGAGTACAGCATGC',
'PRIMER_LEFT_1_TM': 59.670094228849734,
'PRIMER_LEFT_2': (46, 21),
'PRIMER_LEFT_2_END_STABILITY': 4.06,
'PRIMER_LEFT_2_GC_PERCENT': 52.38095238095238,
'PRIMER_LEFT_2_HAIRPIN_TH': 42.52778282883122,
'PRIMER_LEFT_2_MIN_SEQ_QUALITY': 20,
'PRIMER_LEFT_2_PENALTY': 1.3299057711502655,
'PRIMER_LEFT_2_SELF_ANY_TH': 10.513588697583486,
'PRIMER_LEFT_2_SELF_END_TH': 10.513588697583486,
'PRIMER_LEFT_2_SEQUENCE': 'GCATCAGTGAGTACAGCATGC',
'PRIMER_LEFT_2_TM': 59.670094228849734,
'PRIMER_LEFT_3': (46, 21),
'PRIMER_LEFT_3_END_STABILITY': 4.06,
'PRIMER_LEFT_3_GC_PERCENT': 52.38095238095238,
'PRIMER_LEFT_3_HAIRPIN_TH': 42.52778282883122,
'PRIMER_LEFT_3_MIN_SEQ_QUALITY': 20,
'PRIMER_LEFT_3_PENALTY': 1.3299057711502655,
'PRIMER_LEFT_3_SELF_ANY_TH': 10.513588697583486,
'PRIMER_LEFT_3_SELF_END_TH': 10.513588697583486,
'PRIMER_LEFT_3_SEQUENCE': 'GCATCAGTGAGTACAGCATGC',
'PRIMER_LEFT_3_TM': 59.670094228849734,
'PRIMER_LEFT_4': (46, 21),
'PRIMER_LEFT_4_END_STABILITY': 4.06,
'PRIMER_LEFT_4_GC_PERCENT': 52.38095238095238,
'PRIMER_LEFT_4_HAIRPIN_TH': 42.52778282883122,
'PRIMER_LEFT_4_MIN_SEQ_QUALITY': 20,
'PRIMER_LEFT_4_PENALTY': 1.3299057711502655,
'PRIMER_LEFT_4_SELF_ANY_TH': 10.513588697583486,
'PRIMER_LEFT_4_SELF_END_TH': 10.513588697583486,
'PRIMER_LEFT_4_SEQUENCE': 'GCATCAGTGAGTACAGCATGC',
'PRIMER_LEFT_4_TM': 59.670094228849734,
'PRIMER_LEFT_EXPLAIN': 'considered 1997, too many Ns 25, GC content failed '
'32, low tm 1272, high tm 124, ok 544',
'PRIMER_LEFT_NUM_RETURNED': 5,
'PRIMER_PAIR_0_COMPL_ANY_TH': 0.0,
'PRIMER_PAIR_0_COMPL_END_TH': 0.0,
'PRIMER_PAIR_0_PENALTY': 1.373239688566116,
'PRIMER_PAIR_0_PRODUCT_SIZE': 87,
'PRIMER_PAIR_1_COMPL_ANY_TH': 0.0,
'PRIMER_PAIR_1_COMPL_END_TH': 2.43414726309436,
'PRIMER_PAIR_1_PENALTY': 1.5090296435631672,
'PRIMER_PAIR_1_PRODUCT_SIZE': 94,
'PRIMER_PAIR_2_COMPL_ANY_TH': 0.0,
'PRIMER_PAIR_2_COMPL_END_TH': 0.0,
'PRIMER_PAIR_2_PENALTY': 1.8643178301738885,
'PRIMER_PAIR_2_PRODUCT_SIZE': 98,
'PRIMER_PAIR_3_COMPL_ANY_TH': 0.0,
'PRIMER_PAIR_3_COMPL_END_TH': 0.0,
'PRIMER_PAIR_3_PENALTY': 1.9504613679555973,
'PRIMER_PAIR_3_PRODUCT_SIZE': 85,
'PRIMER_PAIR_4_COMPL_ANY_TH': 0.0,
'PRIMER_PAIR_4_COMPL_END_TH': 0.0,
'PRIMER_PAIR_4_PENALTY': 2.019318015989654,
'PRIMER_PAIR_4_PRODUCT_SIZE': 88,
'PRIMER_PAIR_EXPLAIN': 'considered 823, unacceptable product size 808, no '
'internal oligo 9, ok 6',
'PRIMER_PAIR_NUM_RETURNED': 5,
'PRIMER_RIGHT_0': (132, 20),
'PRIMER_RIGHT_0_END_STABILITY': 4.35,
'PRIMER_RIGHT_0_GC_PERCENT': 55.0,
'PRIMER_RIGHT_0_HAIRPIN_TH': 0.0,
'PRIMER_RIGHT_0_MIN_SEQ_QUALITY': 23,
'PRIMER_RIGHT_0_PENALTY': 0.043333917415850465,
'PRIMER_RIGHT_0_SELF_ANY_TH': 0.0,
'PRIMER_RIGHT_0_SELF_END_TH': 0.0,
'PRIMER_RIGHT_0_SEQUENCE': 'TCTCCTCCTTAGCCTGCCTT',
'PRIMER_RIGHT_0_TM': 59.95666608258415,
'PRIMER_RIGHT_1': (139, 20),
'PRIMER_RIGHT_1_END_STABILITY': 3.09,
'PRIMER_RIGHT_1_GC_PERCENT': 60.0,
'PRIMER_RIGHT_1_HAIRPIN_TH': 0.0,
'PRIMER_RIGHT_1_MIN_SEQ_QUALITY': 21,
'PRIMER_RIGHT_1_PENALTY': 0.17912387241290162,
'PRIMER_RIGHT_1_SELF_ANY_TH': 0.0,
'PRIMER_RIGHT_1_SELF_END_TH': 0.0,
'PRIMER_RIGHT_1_SEQUENCE': 'CAGTGCGTCTCCTCCTTAGC',
'PRIMER_RIGHT_1_TM': 60.1791238724129,
'PRIMER_RIGHT_2': (143, 20),
'PRIMER_RIGHT_2_END_STABILITY': 3.69,
'PRIMER_RIGHT_2_GC_PERCENT': 55.0,
'PRIMER_RIGHT_2_HAIRPIN_TH': 0.0,
'PRIMER_RIGHT_2_MIN_SEQ_QUALITY': 21,
'PRIMER_RIGHT_2_PENALTY': 0.534412059023623,
'PRIMER_RIGHT_2_SELF_ANY_TH': 0.0,
'PRIMER_RIGHT_2_SELF_END_TH': 0.0,
'PRIMER_RIGHT_2_SEQUENCE': 'CATTCAGTGCGTCTCCTCCT',
'PRIMER_RIGHT_2_TM': 59.46558794097638,
'PRIMER_RIGHT_3': (130, 20),
'PRIMER_RIGHT_3_END_STABILITY': 2.77,
'PRIMER_RIGHT_3_GC_PERCENT': 55.0,
'PRIMER_RIGHT_3_HAIRPIN_TH': 0.0,
'PRIMER_RIGHT_3_MIN_SEQ_QUALITY': 23,
'PRIMER_RIGHT_3_PENALTY': 0.6205555968053318,
'PRIMER_RIGHT_3_SELF_ANY_TH': 0.0,
'PRIMER_RIGHT_3_SELF_END_TH': 0.0,
'PRIMER_RIGHT_3_SEQUENCE': 'TCCTCCTTAGCCTGCCTTTG',
'PRIMER_RIGHT_3_TM': 59.37944440319467,
'PRIMER_RIGHT_4': (133, 20),
'PRIMER_RIGHT_4_END_STABILITY': 4.75,
'PRIMER_RIGHT_4_GC_PERCENT': 60.0,
'PRIMER_RIGHT_4_HAIRPIN_TH': 0.0,
'PRIMER_RIGHT_4_MIN_SEQ_QUALITY': 23,
'PRIMER_RIGHT_4_PENALTY': 0.6894122448393887,
'PRIMER_RIGHT_4_SELF_ANY_TH': 0.0,
'PRIMER_RIGHT_4_SELF_END_TH': 0.0,
'PRIMER_RIGHT_4_SEQUENCE': 'GTCTCCTCCTTAGCCTGCCT',
'PRIMER_RIGHT_4_TM': 60.68941224483939,
'PRIMER_RIGHT_EXPLAIN': 'considered 1997, too many Ns 25, GC content failed '
'80, low tm 1366, high tm 108, high hairpin stability '
'10, ok 408',
'PRIMER_RIGHT_NUM_RETURNED': 5}
可以看出,把相应的引物都找了出来。
结语
引物设计是湿实验的基本功,希望这个软件能够帮助大家批量的设计引物。
参考文献
https://libnano.github.io/primer3-py/api/index.html
往期精彩回顾:
扫
码
关
注
作者|童蒙
编辑|angelica